document.addEventListener('DOMContentLoaded', function() {
  const changeColorBtn = document.getElementById('changeColorBtn');
  
  changeColorBtn.addEventListener('click', function() {
    // 获取当前活动标签页
    chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
      // 向content script发送消息
      chrome.tabs.sendMessage(tabs[0].id, {action: 'changeBackground'});
    });
  });
});